package com.ljy.my_study.callable;

import java.util.concurrent.Callable;

public class CallableThread implements Callable<Integer>{

	private int sum;
	
	@Override
	public Integer call() throws Exception {
		long start=System.currentTimeMillis();
		for(int i=0;i<10000;i++) {
			sum+=i;
		}
		long end=System.currentTimeMillis();
		System.out.println("spend time: "+(end-start)+" ms");
		Thread.sleep(500);
		return sum;
	}
	
}
